{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Time used: 0.011896371841430664\n",
      "[[3859 4102 4039 ... 4094 4051 4036]\n",
      " [3767 4183 4138 ... 4026 3990 4018]\n",
      " [4032 4075 4172 ... 4355 3943 4162]\n",
      " ...\n",
      " [4091 4175 4437 ... 4319 4299 4240]\n",
      " [4182 4405 4393 ... 4494 4443 4493]\n",
      " [3990 4247 4308 ... 4335 4308 4276]]\n",
      "Time used: 3.834149122238159\n",
      "[[3859. 4102. 4039. ... 4094. 4051. 4036.]\n",
      " [3767. 4183. 4138. ... 4026. 3990. 4018.]\n",
      " [4032. 4075. 4172. ... 4355. 3943. 4162.]\n",
      " ...\n",
      " [4091. 4175. 4437. ... 4319. 4299. 4240.]\n",
      " [4182. 4405. 4393. ... 4494. 4443. 4493.]\n",
      " [3990. 4247. 4308. ... 4335. 4308. 4276.]]\n"
     ]
    }
   ],
   "source": [
    "from numpy.random import randint\n",
    "import time\n",
    "import numpy as np\n",
    "\n",
    "num = 200\n",
    "\n",
    "A = randint(0,10,size=(num,num))\n",
    "B = randint(0,10,size=(num,num))\n",
    "\n",
    "start_time = time.time()\n",
    "C_1 = A@B\n",
    "stop_time = time.time()\n",
    "time_used = stop_time - start_time\n",
    "print(f\"Time used: {time_used}\")\n",
    "print(C_1)\n",
    "\n",
    "C_2 = np.zeros((num,num))\n",
    "start_time = time.time()\n",
    "for i in range(num):\n",
    "    for j in range(num):\n",
    "        for k in range(num):\n",
    "            C_2[i,j] += A[i,k]*B[k,j]\n",
    "time_used = time.time() - start_time\n",
    "print(f\"Time used: {time_used}\")\n",
    "print(C_2)\n",
    "\n"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 2,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[2, 4, 6, 8, 10]\n"
     ]
    }
   ],
   "source": [
    "even_numbers = [x for x in range(1,11) if x % 2 == 0]\n",
    "print(even_numbers)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "[[1, 2, 3], [2, 4, 6], [3, 6, 9]]\n"
     ]
    }
   ],
   "source": [
    "matrix = [[i * j for j in range(1, 4)]\n",
    "            for i in range(1, 4)]\n",
    "print(matrix)"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.11.5"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
